<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>title</title>
</head>
<body>
<div id="app">
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    function save() {
        let user={
            username:"yaya",
            password:"123456"
        };
        return axios.post("http://localhost:8080/user/save",user);
    }
    function findAll() {
        axios.get("http://localhost:8080/user/findAll");
    }

    //并发请求
    axios.all([save(),findAll()]).then(  //传入函数数组
        axios.spread(function (res1,res2) { //res1和res2分别是两个函数的返回结果
            console.log(res1.data);
            console.log(res2.data);
        })
    );
</script>
<script>
    const app=new Vue({
        el:"#app",
    });
</script>
</body>
</html>